package com.longtop.framework.sys.user.service;

/**
 * @author 孙景弘
 */

import java.util.HashMap;

import com.longtop.framework.base.BaseAction;
import com.longtop.framework.security.SessionObject;
import com.longtop.framework.sys.user.service.UserService;
import com.longtop.framework.util.WebUtil;
import com.longtop.intelliweb.action.IInitContext;
import com.longtop.intelliweb.view.Dataset;

public class UserInfoAction extends BaseAction {

	private final static String DATASET_USER = "Dataset_User";
	private final static String DATASET_ROLE = "Dataset_Role";

	/**
	 * 初始化页面
	 * 
	 * @param context
	 */
	public void init(IInitContext context) {
		super.init(context);
	}

	/**
	 * 本页jsp：初始化业务数据(覆写父类方法)
	 */
	public void thisPageInit(IInitContext context) {
		// 初始化数据
		Dataset userDataset = context.getDataset(DATASET_USER);
		if (!WebUtil.validateDatasetExist(this, userDataset, DATASET_USER)) {
			return;
		}
		// 调用Spring的业务逻辑类
		UserService userService = getBean(UserService.BEAN_ID);
		HashMap hashMap = new HashMap();

		SessionObject sessionObject = this.getSessionObject(context);
		hashMap.put("userId", sessionObject.getUserId());
		userService.queryForPageByIbatis("sysUserSql.selectUserInfo", null, hashMap, userDataset, false);

	}

}
